/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package question2;

/**
 *
 * @author Avuyile
 */
public class Student {
    private String firstName;
    private String lastName;
    private int studentNumber;
    private String phoneNumber;
    
    public Student(String firstName, String lastName, int studentNumber, String phoneNumber){
        this.firstName = firstName;
        this.lastName = lastName;
        this.studentNumber = studentNumber;
        this.phoneNumber = phoneNumber;  
    }
    
    public void setFirstName(String firstName){this.firstName = firstName;}
    public String getFirstName(){    return firstName;}
    
    public void setLastName(String lastName){    this.lastName = lastName;}
    public String getLastName(){   return lastName;}
    
    public void setStudentNumber(int studentNumber){ this.studentNumber = studentNumber;}
    public int getStudentNumber(){   return studentNumber;}
    
    public void setPhoneNumber(String phoneNumber){  this.phoneNumber = phoneNumber;}
    public String getPhoneNumber(){  return phoneNumber;}
    
    
    @Override
    public String toString(){  return (getFirstName()+" "+ getLastName()+" "+getStudentNumber()+" "+getPhoneNumber());
    }
    
    @Override
    public int hashCode() {
        int hash = 5;
        hash = 23 * hash + this.studentNumber;
        return hash;
    }
    
    @Override
    public boolean equals(Object o){
        if(o == null){
            return false;
        }
        if(o == this){
            return true;
        }
        if(getClass() != o.getClass()){
            return false;
        }
        Student stud = (Student) o;
        return (this.getStudentNumber() == stud.getStudentNumber());
    }
}
